<template>
   
  <div>
    <el-table :data="specsList" style="width: 100%">

      <el-table-column prop="specsname" label="属性名称" width="180">
      </el-table-column>
      <el-table-column label="属性值" width="180">
       <template slot-scope="scope">
         <el-button type="primary" size="mini" plain v-for="(item,index) in scope.row.attrs" :key="index">{{item}}</el-button>
       </template>
      </el-table-column>
      <el-table-column prop="status" label="状态">
        <template slot-scope="scope">
          <el-tag :type="scope.row.status == 1 ? 'success' : 'warning'">
            {{ scope.row.status == 1 ? "启用" : "禁用" }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)"
            >编辑</el-button
          >
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  props: ["specsList", "oppen"],
  data() {
    return {
 
    };
  },
  methods: {
    //编辑
    handleEdit(index, row) {
     this.$BUS.$emit('edits',row)
    },
    //删除
    handleDelete(index, row) {
      console.log(index, row);
      this.$emit('remove',row.id)
    },
  },
  created() {},
  mounted() {},
  components: {},
  computed: {},
  watch: {},
};
</script>

<style lang='scss' scoped>
</style>
